#include<bits/stdc++.h>

using namespace std;

int main() {
    int n = 10;
    int *p = new int[n], size = 0;
    for (int i = 0; i < 10000; i++) {
        if (size >= n) {//翻倍扩容算法
            n <<= 1;
            int *q = new int[n];
            for (int j = 0; j < n/2; j++)q[j] = p[j];
            delete[] p;
            p = q;
        }
        a[size++] = i;
    }
    return 0;
}